package com.xxxx.server.controller;


import com.xxxx.server.mq.send.SendMailManager;
import com.xxxx.server.service.IMailLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhoubin
 * @since 2020-09-07
 */
@RestController
@RequestMapping("/mail-log")
public class MailLogController {
    @Autowired
    private IMailLogService mailLogService;
    @Autowired
    private SendMailManager sendMailManager;

    @ApiOperation("员工id")
    @GetMapping("/test/")
    public void testMail(Integer id){
        mailLogService.insertNewEvent(id);
    }

    @ApiOperation("发送邮件")
    @GetMapping("/test/send")
    public void testMail(String email){
        sendMailManager.sendSimpleMail(email);
    }

}
